package com.wzq.permission.client.model;

import org.apache.commons.lang.StringUtils;



/**
 * easy ui 分页参数
 * @author Administrator
 *
 */
public class EasyUiPager {
	/**
	 * 页码
	 */
	private int page = 1;

	/**
	 * 每页条数
	 */
	private int rows = Integer.MAX_VALUE;

	/**
	 * 排序字段
	 */
	private String sort;

	/**
	 * 排序顺序
	 */
	private String order = ASC;
	
	/**
	 * 升序
	 */
	public final static String ASC ="ASC";
	
	/**
	 * 降序
	 */
	public final static String DESC ="DESC";

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}
	
	public String getOrderCondition(){
		if(StringUtils.isNotBlank(sort)){
			return "order by "+sort+" "+order;
		}else{
			return "";
		}
	}
}
